[id].vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation></HomePageNavigation>
  6. <!-- 公司信息详情页 -->
  7. <section class="index_main">
  8. <!-- 列表页广告一 -->
  9. <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
  10. <!-- 面包屑导航 -->
  11. <div class="breadcrumb phone_none">
  12. <div class="inner">
  13. <span class="location">当前位置:</span>
  14. <el-breadcrumb :separator-icon="ArrowRight">
  15. <el-breadcrumb-item>
  16. <NuxtLink to="/">首页</NuxtLink>
  17. </el-breadcrumb-item>
  18. <el-breadcrumb-item v-if="parent_name != ''">
  19. <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
  20. </el-breadcrumb-item>
  21. <el-breadcrumb-item>
  22. <NuxtLink :to="`list-1.html`"> {{ routeName }}</NuxtLink>
  23. </el-breadcrumb-item>
  24. <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
  25. </el-breadcrumb>
  26. </div>
  27. </div>
  28. <div class="breadcrumb_box pc_none">
  29. <span class=" ">当前位置:</span>
  30. <NuxtLink to="/">首页</NuxtLink>
  31. <span class=" " v-if="parent_name !=''">&gt;</span>
  32. <NuxtLink v-if="parent_name !=''" :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
  33. <span class=" " >&gt;</span>
  34. <NuxtLink :to="`list-1.html`"> {{ routeName }}</NuxtLink>
  35. <span class="" >&gt;</span>
  36. <span class="" >{{ routeNewsTtitle }}</span>
  37. </div>
  38. <!-- 面包屑 end-->
  39. <div class="info_head_box clearfix phone_none">
  40. <div class="info_head_left">
  41. <a class="info_head_a info_head_only" :title="公司信息">公司信息</a>
  42. </div>
  43. </div>
  44. <div class="phone_box_1 pc_none" >
  45. <div class="phone_box_1_head">
  46. <a class="" >公司信息</a>
  47. </div>
  48. </div>
  49. <section class="index_2 clearfix">
  50. <img class="index_2_img" :src="detailImg[0]" :title="routeNewsTtitle" alt="">
  51. <div class="index_2_right">
  52. <h4 class="index_2_h4"> {{ routeNewsTtitle }}</h4>
  53. <div class="index_2_title_box clearfix">
  54. <time class="index_2_title">
  55. 成立日期:
  56. <span v-if="time"> {{ time }}</span>
  57. </time>
  58. <span class="index_2_title">
  59. 所在城市:
  60. <span v-if="newsDetail.city_name">{{ newsDetail.city_name }}</span>
  61. </span>
  62. </div>
  63. <div class="index_2_ul clearfix phone_none">
  64. <div class="index_2_ul_left">
  65. <div class="index_2_li clearfix">
  66. <label class="index_2_li_label">机构性质</label>
  67. <span class="index_2_li_text " v-if="newsDetail.jobnature_name">
  68. {{ newsDetail.jobnature_name }}</span>
  69. </div>
  70. <div class="index_2_li clearfix">
  71. <label class="index_2_li_label">负 责 人</label>
  72. <span class="index_2_li_text" v-if="newsDetail.manager">
  73. {{ newsDetail.manager }}
  74. </span>
  75. </div>
  76. <div class="index_2_li clearfix">
  77. <label class="index_2_li_label">联 系 人</label>
  78. <span class="index_2_li_text " v-if="newsDetail.content_person">
  79. {{ newsDetail.content_person }}
  80. </span>
  81. </div>
  82. <div class="index_2_li clearfix">
  83. <label class="index_2_li_label">联系电话</label>
  84. <span class="index_2_li_text ">{{ newsDetail.telephone }}</span>
  85. </div>
  86. <div class="index_2_li clearfix">
  87. <label class="index_2_li_label">手 &nbsp;&nbsp;&nbsp;&nbsp; 机</label>
  88. <span class="index_2_li_text ">{{ newsDetail.mobile }}</span>
  89. </div>
  90. <div class="index_2_li clearfix">
  91. <label class="index_2_li_label">地 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  92. <span class="index_2_li_text ">{{ newsDetail.adress }}</span>
  93. </div>
  94. </div>
  95. <div class="index_2_ul_left">
  96. <div class="index_2_li clearfix">
  97. <label class="index_2_li_label">所属行业</label>
  98. <span class="index_2_li_text ">{{ newsDetail.hy_name }}</span>
  99. </div>
  100. <div class="index_2_li clearfix">
  101. <label class="index_2_li_label">联系QQ</label>
  102. <span class="index_2_li_text ">{{ newsDetail.QQ }}</span>
  103. </div>
  104. <div class="index_2_li clearfix">
  105. <label class="index_2_li_label">网 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  106. <span class="index_2_li_text ">{{ newsDetail.company_url }}</span>
  107. </div>
  108. <div class="index_2_li clearfix">
  109. <label class="index_2_li_label">邮政编码</label>
  110. <span class="index_2_li_text ">{{ newsDetail.post_code }}</span>
  111. </div>
  112. <div class="index_2_li clearfix">
  113. <label class="index_2_li_label">传 &nbsp;&nbsp;&nbsp;&nbsp; 真</label>
  114. <span class="index_2_li_text ">{{ newsDetail.fax }}</span>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="index_2_ul clearfix pc_none">
  119. <div class="index_2_ul_left">
  120. <div class="index_2_li clearfix">
  121. <label class="index_2_li_label">机构性质</label>
  122. <span class="index_2_li_text " v-if="newsDetail.jobnature_name">
  123. {{ newsDetail.jobnature_name }}</span>
  124. </div>
  125. <div class="index_2_li clearfix">
  126. <label class="index_2_li_label">所属行业</label>
  127. <span class="index_2_li_text ">{{ newsDetail.hy_name }}</span>
  128. </div>
  129. <div class="index_2_li clearfix">
  130. <label class="index_2_li_label">负 责 人</label>
  131. <span class="index_2_li_text" v-if="newsDetail.manager">
  132. {{ newsDetail.manager }}
  133. </span>
  134. </div>
  135. <div class="index_2_li clearfix">
  136. <label class="index_2_li_label">联 系 人</label>
  137. <span class="index_2_li_text " v-if="newsDetail.content_person">
  138. {{ newsDetail.content_person }}
  139. </span>
  140. </div>
  141. <div class="index_2_li clearfix">
  142. <label class="index_2_li_label">联系电话</label>
  143. <span class="index_2_li_text ">{{ newsDetail.telephone }}</span>
  144. </div>
  145. <div class="index_2_li clearfix">
  146. <label class="index_2_li_label">手 &nbsp;&nbsp;&nbsp;&nbsp; 机</label>
  147. <span class="index_2_li_text ">{{ newsDetail.mobile }}</span>
  148. </div>
  149. <div class="index_2_li clearfix">
  150. <label class="index_2_li_label">联系QQ</label>
  151. <span class="index_2_li_text ">{{ newsDetail.QQ }}</span>
  152. </div>
  153. <div class="index_2_li clearfix">
  154. <label class="index_2_li_label">传 &nbsp;&nbsp;&nbsp;&nbsp; 真</label>
  155. <span class="index_2_li_text ">{{ newsDetail.fax }}</span>
  156. </div>
  157. <div class="index_2_li clearfix">
  158. <label class="index_2_li_label">邮政编码</label>
  159. <span class="index_2_li_text ">{{ newsDetail.post_code }}</span>
  160. </div>
  161. <div class="index_2_li clearfix">
  162. <label class="index_2_li_label">网 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  163. <span class="index_2_li_text ">{{ newsDetail.company_url }}</span>
  164. </div>
  165. <div class="index_2_li clearfix">
  166. <label class="index_2_li_label">地 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  167. <span class="index_2_li_text ">{{ newsDetail.adress }}</span>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </section>
  173. <section class="index_3 clearfix">
  174. <div class="info_2_head_box clearfix phone_none">
  175. <div class="info_2_head_left">
  176. <a class="info_2_head_a info_2_head_only" title="">详情信息</a>
  177. </div>
  178. </div>
  179. <div class="phone_box_1 pc_none" >
  180. <div class="phone_box_1_head">
  181. <a class="" >详情信息</a>
  182. </div>
  183. </div>
  184. <div class="info_article" v-html="newsDetail.content"></div>
  185. </section>
  186. </section>
  187. <!-- 列表页广告二 -->
  188. <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
  189. <!-- 页面底部 -->
  190. <HomeFoot1></HomeFoot1>
  191. </template>
  192. <script setup>
  193. import { ref } from 'vue'
  194. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  195. import { ArrowRight } from '@element-plus/icons-vue'
  196. //2.页面路径 start ---------------------------------------->
  197. const route = useRoute();
  198. const articleId = parseInt(route.params.id);
  199. const targetSegment = getRoutePath(1);
  200. const targetSegment1 = getRoutePath(2);
  201. // 2.1 查询一级栏目的id
  202. //通过导航路径反向查询导航id
  203. let routeId;
  204. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  205. method: 'GET',
  206. query: {
  207. 'pinyin': targetSegment,
  208. },
  209. });
  210. if (getRouteId.code == 200) {
  211. routeId = getRouteId.data.category_id
  212. } else {
  213. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  214. console.log("错误位置:通过url路径查询导航池id")
  215. console.log("后端错误反馈:", getRouteId.message)
  216. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  217. }
  218. // 2.2查询二级栏目的id及名称
  219. let routeName = ref('');
  220. let routeId1 = ref('');
  221. const getRoutePName = await requestDataPromise('/web/getWebsiteRoute', {
  222. method: 'GET',
  223. query: {
  224. 'pinyin': targetSegment + "/" + targetSegment1,
  225. },
  226. });
  227. if (getRoutePName.code == 200) {
  228. routeId1.value = getRoutePName.data.category_id;
  229. routeName.value = getRoutePName.data.alias;
  230. } else {
  231. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  232. console.log("错误位置:通过url路径查询导航池id")
  233. console.log("后端错误反馈:", getRouteId.message)
  234. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  235. }
  236. //2.页面路径 end ---------------------------------------->
  237. //3.面包屑 start ---------------------------------------->
  238. const parent_name = ref("");
  239. const parent_id = ref("");
  240. const parent_pinyin = ref("");
  241. let getParentNav = async () => {
  242. const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
  243. method: 'GET',
  244. query: {
  245. 'catid': routeId
  246. },
  247. });
  248. if (listData.code == 200) {
  249. parent_name.value = listData.data.alias;
  250. parent_id.value = listData.data.parent_id;
  251. parent_pinyin.value = listData.data.aLIas_pinyin;
  252. } else {
  253. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  254. console.log("错误位置:获取面包屑导航")
  255. console.log("后端错误反馈:", listData.message)
  256. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  257. }
  258. }
  259. //获得父级栏目详情
  260. getParentNav();
  261. //3.面包屑 end ---------------------------------------->
  262. //4.新闻详情 start ---------------------------------------->
  263. //4.1 资讯详情
  264. const newsDetail = ref({})
  265. const routeNewsTtitle = ref("");
  266. //4.2 发布日期
  267. const time = ref("");
  268. //4.3 路径
  269. const routLevelTitle = ref("");
  270. const routLevelId = ref("");
  271. //4.4 是否展示投票
  272. const articleChoice = ref(false);
  273. let detailImg = ref('');
  274. let seoTitle;
  275. let seoDescription;
  276. let seoKeywords;
  277. //4.5 获取详情
  278. const mkdata = await requestDataPromise('/web/getWebsiteCompanyInfo', {
  279. method: 'GET',
  280. query: {
  281. 'id': articleId
  282. },
  283. });
  284. if (mkdata.code == 200) {
  285. //获取内容
  286. newsDetail.value = mkdata.data;
  287. detailImg.value = JSON.parse(mkdata.data.imgurl);
  288. //修正标题长度
  289. if (newsDetail.value.title.length >= 20) {
  290. routeNewsTtitle.value = newsDetail.value.title.substr(0, 20) + "...";
  291. } else {
  292. routeNewsTtitle.value = newsDetail.value.title
  293. }
  294. //获取发布时间
  295. if (newsDetail.value.data) {
  296. time.value = newsDetail.value.data.split(' ')[0];
  297. }
  298. seoTitle = newsDetail.value.title;
  299. seoDescription = newsDetail.value.description;
  300. seoKeywords = newsDetail.value.keyword;
  301. } else {
  302. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  303. // console.log("错误位置:获取详情内容")
  304. // console.log("后端错误反馈:", mkdata.message)
  305. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  306. }
  307. //4.新闻详情 end ---------------------------------------->
  308. //5.设置seo信息 start---------------------------------------->
  309. const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
  310. method: 'GET',
  311. query: {
  312. 'catid': routeId1.value
  313. },
  314. });
  315. if (setData.code == 200) {
  316. let seoSuffix = setData.data.suffix;
  317. let seoName = setData.data.website_name;
  318. useSeoMeta({
  319. title: seoTitle + "_" + seoName + "_" + seoSuffix,
  320. meta: [
  321. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  322. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  323. { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no',tagPriority: 10 }
  324. ]
  325. });
  326. } else {
  327. console.log("设置频道页SEO出错!", setData.message)
  328. }
  329. //5.设置seo信息 end---------------------------------------->
  330. //6.广告 start ---------------------------------------->
  331. let adImg1 = ref([]);
  332. let adImg2 = ref([]);
  333. onMounted(async () => {
  334. const { $webUrl, $CwebUrl } = useNuxtApp();
  335. //广告1
  336. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_detail_0001`
  337. const responseAd1 = await fetch(url, {
  338. headers: {
  339. 'Content-Type': 'application/json',
  340. 'Userurl': $CwebUrl,
  341. 'Origin': $CwebUrl
  342. }
  343. });
  344. const resultAd1 = await responseAd1.json();
  345. adImg1.value = resultAd1.data[0];
  346. //广告2
  347. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_detail_0002`
  348. const responseAd2 = await fetch(url2, {
  349. headers: {
  350. 'Content-Type': 'application/json',
  351. 'Userurl': $CwebUrl,
  352. 'Origin': $CwebUrl
  353. }
  354. });
  355. const resultAd2 = await responseAd2.json();
  356. adImg2.value = resultAd2.data[0];
  357. })
  358. //6.广告 end ---------------------------------------->
  359. </script>
  360. <style lang="less" scoped>
  361. @import url(@/assets/css/peixun/detail.less);
  362. </style>
  363. <style lang="less" scoped>
  364. @media screen and (min-width:801px){/*pc*/
  365. .page_pc_none {
  366. display: none !important;
  367. }
  368. .pc_none{display:none;}
  369. }
  370. @media screen and (max-width:800px){/*ipad_phone*/
  371. .index_main{width:100%;margin:0px auto 30px;}
  372. .breadcrumb_box {
  373. height: 22px;
  374. width: 92%;
  375. margin: 10px auto;
  376. word-break: keep-all;
  377. white-space: nowrap;
  378. overflow: hidden;
  379. text-overflow: ellipsis;
  380. font-size: 14px;
  381. color: #666;
  382. * {
  383. font-size: 14px;
  384. display: inline;
  385. color: #666;
  386. line-height: 22px;
  387. height: 22px;
  388. margin-right: 5px;
  389. }
  390. }
  391. .phone_box_1{
  392. width:92%;margin:0px auto 0px;
  393. .phone_box_1_head{
  394. height:50px;line-height:50px;
  395. background:#fff;border-bottom:1px solid #E6E6E6;
  396. width:100%;
  397. a{
  398. float:left;height:50px;line-height:50px;margin:0;position:relative;
  399. color:#489d97;font-size:18px; font-weight:bold;box-sizing:border-box;
  400. position:relative;padding-left:8px;
  401. }
  402. a::before{
  403. content: '';display: block;
  404. position:absolute;left:0px;top:18px;
  405. background: linear-gradient(to top, #0998A9, #6ADDD6);
  406. width:3px;height:15px;
  407. }
  408. }
  409. }
  410. .phone_box_2{
  411. width:92%;margin:0px auto 0px;
  412. .phone_box_1_head{
  413. height:50px;line-height:50px;
  414. background:#fff;border-bottom:1px solid #E6E6E6;
  415. width:100%;
  416. a{
  417. float:left;height:50px;line-height:50px;margin:0;position:relative;
  418. color:#489d97;font-size:18px; font-weight:bold;box-sizing:border-box;
  419. position:relative;padding-left:8px;
  420. }
  421. a::before{
  422. content: '';display: block;
  423. position:absolute;left:0px;top:18px;
  424. background: linear-gradient(to top, #0998A9, #6ADDD6);
  425. width:3px;height:15px;
  426. }
  427. }
  428. }
  429. .index_2{width:100%;margin:10px auto 0px;}
  430. .index_2_img{max-width:92%;height:302px;width:auto;
  431. margin:0px auto 0px;float:none;display:block;border-radius:8px;}
  432. .index_2_right{width:92%;float:none;margin:0px auto;}
  433. .index_2_h4{font-size:16px;color:#333;line-height:26px; padding:0;border:0px;
  434. white-space:unset;word-break:unset;margin-top:11px;
  435. }
  436. .index_2_title{font-size:14px;margin-right:10px;}
  437. .index_2_ul{ height:auto;}
  438. .index_2_li{margin-bottom:20px;width:49%;}
  439. .index_2_li:nth-of-type(odd){float:left;}
  440. .index_2_li:nth-of-type(even){float:right;}
  441. .index_2_li:nth-last-of-type(1){width:100%; }
  442. .index_2_li:nth-last-of-type(2){width:100%; }
  443. .index_2_li:nth-of-type(1){width:100%; }
  444. .index_2_li:nth-of-type(2){width:100%; }
  445. .index_2_li .index_2_li_label{line-height:18px;height:18px;font-size:14px;min-width:auto;margin-right:8px;}
  446. .index_2_li .index_2_li_text{
  447. line-height:18px;font-size:14px;flex:1;
  448. word-wrap: break-word;
  449. overflow-wrap: break-word;
  450. white-space: pre-wrap;
  451. word-break: break-all;
  452. }
  453. .index_2_ul .index_2_ul_left{width:100%;overflow:hidden;float:none;}
  454. .info_article{ font-size:16px!important;line-height:26px!important;margin:15px auto 0!important;width:92%!important;}
  455. .info_article::v-deep *{ font-size:16px!important;line-height:26px!important; }
  456. .page_phone_none {
  457. display: none !important;
  458. }
  459. .phone_none{display:none;}
  460. }
  461. </style>